﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeRay2d : OdGeLinearEnt2d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeRay2d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeRay2d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeRay2d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeRay2d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeRay2d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeRay2d() : this(GlobalsPINVOKE.new_OdGeRay2d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeRay2d(OdGeRay2d ray) : this(GlobalsPINVOKE.new_OdGeRay2d__SWIG_1(OdGeRay2d.getCPtr(ray)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeRay2d(OdGePoint2d point, OdGeVector2d vect) : this(GlobalsPINVOKE.new_OdGeRay2d__SWIG_2(OdGePoint2d.getCPtr(point), OdGeVector2d.getCPtr(vect).Handle), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeRay2d(OdGePoint2d point1, OdGePoint2d point2) : this(GlobalsPINVOKE.new_OdGeRay2d__SWIG_3(OdGePoint2d.getCPtr(point1), OdGePoint2d.getCPtr(point2)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeRay2d set(OdGePoint2d point, OdGeVector2d vect)
		{
			OdGeRay2d result = new OdGeRay2d(GlobalsPINVOKE.OdGeRay2d_set__SWIG_0(this.swigCPtr, OdGePoint2d.getCPtr(point), OdGeVector2d.getCPtr(vect).Handle), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeRay2d set(OdGePoint2d point1, OdGePoint2d point2)
		{
			OdGeRay2d result = new OdGeRay2d(GlobalsPINVOKE.OdGeRay2d_set__SWIG_1(this.swigCPtr, OdGePoint2d.getCPtr(point1), OdGePoint2d.getCPtr(point2)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeRay2d Assign(OdGeRay2d ray)
		{
			OdGeRay2d result = new OdGeRay2d(GlobalsPINVOKE.OdGeRay2d_Assign(this.swigCPtr, OdGeRay2d.getCPtr(ray)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
